int data[100000] = {0};
int cmp(const void *a, const void *b)
{
    return *(int*)a-*(int*)b;
}
struct ListNode* sortList(struct ListNode* head) {
    if(head==NULL || head->next==NULL)  return head;

    struct ListNode *temp = NULL;
    int cnt = 0;

    for(temp=head; temp != NULL; temp = temp->next)
        data[cnt++] = temp->val;

qsort(data, cnt, sizeof(int), cmp);

cnt = 0;
for(temp=head; temp != NULL; temp = temp->next)
{
    temp->val = data[cnt++];
}
return head;
}